#ifndef DBHELPER_H
#define DBHELPER_H
#include <QObject>
#include <QHash>
#include <QSqlQuery>
class DbHelper
{
public:
    DbHelper();
    int SetSqlStrNonQuery(const QString &sql, QHash<QString, QString> param);
    int Insert(const QString &tablename,QHash<QString, QString> list, bool returnval=false);
    void Update(const QString &tablename,QHash<QString,QString> list,QHash<QString,QString> where);
    void Delete(const QString &tablename,QHash<QString,QString> where);
    QString GetSqlStrScalar(const QString &sql, QHash<QString, QString> param);
    QSqlQuery GetSqlStrQuery(const QString &sql,QHash<QString, QString> param);
private:
    QString exchangeparam(const QString &param);
    bool isSysTime(const QString& s);
};

#endif // DBHELPER_H
